package com.app.micaihu.view.login.utils

import com.app.micaihu.view.login.activity.*
import com.blankj.utilcode.util.ActivityUtils
import com.chuanglan.shanyan_sdk.OneKeyLoginManager

class CloseLoginActivityUtils {
    companion object {
        /**
         * 登录成功后 关闭 所以登录跳转的界面
         */
        fun closeAllLoginActivity() {
            OneKeyLoginManager.getInstance().removeAllListener()
            OneKeyLoginManager.getInstance().finishAuthActivity()
            ActivityUtils.finishActivity(AccountLoginActivity::class.java)
            ActivityUtils.finishActivity(ForgetPasswordActivity::class.java)
            ActivityUtils.finishActivity(ForgetPasswordConfirmActivity::class.java)
            ActivityUtils.finishActivity(LastLoginActivity::class.java)
            ActivityUtils.finishActivity(PhoneCodeActivity::class.java)
            ActivityUtils.finishActivity(PhoneLoginActivity::class.java)
            ActivityUtils.finishActivity(PlatFormInfoActivity::class.java)
            ActivityUtils.finishActivity(QuickLoginActivity::class.java)
        }
        /**
         * 绑定手机成功后 关闭 所以跳转的界面
         */
        fun closeAllBindPhoneActivity() {
            OneKeyLoginManager.getInstance().removeAllListener()
            OneKeyLoginManager.getInstance().finishAuthActivity()
            ActivityUtils.finishActivity(BindPhoneActivity::class.java)
            ActivityUtils.finishActivity(BindPhoneByCodeActivity::class.java)
            ActivityUtils.finishActivity(BindPhoneByCodeConfirmActivity::class.java)
        }
    }
}